# find函数用来寻找子串在字符串中的位置
str = "字符串常用方法"
print("子串的起始位置是", str.find("常用"))

# lower函数用来把全部字符变成小写字符
str = "AppLe"
print("小写字符串为", str.lower())

# replace函数用来把字符串中的一部分进行【全部】替换
str = "The book is a book of science"
print(str.replace("book", "video"))

# join用来合并字符串
sep = ["1", "2", "3"]
str = ""
print(str.join(sep))  # 输出123
str = "+"
print(str.join(sep))  # 输出1+2+3

# split用来拆分字符串
str = "1+2+3"
print(str.split("+"))  # 输出['1', '2', '3']

# strip用来去除字符串前后的空格
str = "  what's that  "
print(str.strip())  # 输出what's that
